package com.angus.common.core.enums;

import lombok.Getter;

/**
 * @author liyanan
 * @date 2024/08/30 2:56 PM
 * @description
 */
@Getter
public enum ContentType {

    CN("CN", "四千汉字集束速记"),
    EN("EN", "英语词汇集束速记");



    private final String typeCode;

    private final String typeName;

    ContentType(String typeCode, String typeName) {
        this.typeCode = typeCode;
        this.typeName = typeName;
    }

    public static String fromCode(String typeCode) {
        ContentType[] values = ContentType.values();
        for (ContentType value : values) {
            if (value.getTypeCode().equals(typeCode)) {
                return value.getTypeCode();
            }
        }
        return "CN";
    }
}
